package com.itheima.anno;

import com.itheima.validation.StateValidation;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.*;

@Documented //元注解
@Target({ ElementType.FIELD})// 元注解，这里只校验字段
@Retention(RetentionPolicy.RUNTIME)// 元注解
@Constraint(
        validatedBy = {StateValidation.class}
)// 指定谁提供校验规则


public @interface State {
    String message() default "state参数的值只能为发布或草稿";// 校验失败后的提示信息
//指定分组
    Class<?>[] groups() default {};

    // 负载 获取到State注解的附加信息
    Class<? extends Payload>[] payload() default {};
}
